import numpy as np
import pandas as pd

def time_processing(path):
    #1.获取数据
    data = pd.read_csv(path)
    #2.格式化
    data['time'] = pd.to_datetime(data['time']).dt.strftime('%Y-%m-%d %H:%M:%S')
    #3.按照时间剩余排序
    data.sort_values(by='time',inplace=True)
    #4.去重
    data.drop_duplicates(inplace=True)
    return data

if __name__ == '__main__':
    data_df = time_processing('../data/test.csv')
    print(data_df.head())
